{% extends 'learning_logs/base.html' %}

{% block header %}
	<h2>{{topic}}</h2>
{% endblock header %}

{% block content %}
	<p>
		<a href="{% url 'learning_logs:new_entry' topic.id %}">添加一个条目</a>
	</p>

	{% for entry in entries %}
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3>
					{{ entry.date_added | date:'Y-m-d H:i' }}
					<small>
						<a href="{% url 'learning_logs:edit_entry' entry.id %}">编辑</a>
					</small>
				</h3>
			</div>
			<dir class="panel-body">
				{{ entry.text | linebreaks }}
			</dir>
		</div><!-- /.panel -->
	{% empty %}
		没有学习笔记
	{% endfor %}

	<!-- <ul>
		{% for entry in entries %}
			<li>
				<p>{{ entry.date_added | date:'Y-m-d H:i' }}</p>
				<p>{{ entry.text|linebreaks }}</p>
				<p>
					<a href="{% url 'learning_logs:edit_entry' entry.id %}">编辑</a>
				</p>
			</li>
		{% empty %}
			<li>
				没有学习笔记
			</li>
		{% endfor %}
	</ul> -->

{% endblock content %}